﻿<UserControl x:Class="VS_DiffAllFiles.Settings.DiffAllFilesSettingsPageControl"
						 xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
						 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
						 xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
						 xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
						 xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
						 xmlns:QC="clr-namespace:QuickConverter;assembly=QuickConverter"
						 mc:Ignorable="d" 
						 d:DesignHeight="350" d:DesignWidth="400" LostKeyboardFocus="UserControl_LostKeyboardFocus">
	<UserControl.Resources>
		<Style TargetType="{x:Type Button}">
			<Setter Property="Padding" Value="5" />
			<Setter Property="ToolTipService.ShowDuration" Value="60000" />
		</Style>
		<Style TargetType="{x:Type CheckBox}">
			<Setter Property="Margin" Value="0,5,0,0" />
			<Setter Property="VerticalAlignment" Value="Center" />
			<Setter Property="ToolTipService.ShowDuration" Value="60000" />
		</Style>
		<Style TargetType="{x:Type TextBlock}">
			<Setter Property="ToolTipService.ShowDuration" Value="60000" />
		</Style>
		<Style TargetType="{x:Type TextBox}">
			<Setter Property="ToolTipService.ShowDuration" Value="60000" />
		</Style>
		<Style TargetType="{x:Type GroupBox}">
			<Setter Property="Padding" Value="2" />
		</Style>
	</UserControl.Resources>

	<Grid>
		<StackPanel Orientation="Vertical" Margin="0">
			
			<GroupBox Header="General Settings">
				<StackPanel Orientation="Vertical">
					<CheckBox Content="Compare new files" IsChecked="{Binding Path=CompareNewFiles}" ToolTip="If files being added to source control should be compared." />
					<CheckBox Content="Compare deleted files" IsChecked="{Binding Path=CompareDeletedFiles}" ToolTip="If files being deleted from source control should be compared." />
					<!--<CheckBox Content="Compare files whose contents have not changed (TFS only)" IsChecked="{Binding Path=CompareFilesNotChanged}" ToolTip="If files that are checked out of TFS, but not actually changed should be compared." />-->
					<Label Content="File Extensions To Ignore (e.g. exe, bmp, png)" Margin="0,5,0,0" />
					<TextBox Text="{Binding Path=FileExtensionsToIgnore}" HorizontalAlignment="Stretch" ToolTip="File types to not compare." />
				</StackPanel>
			</GroupBox>
			
			<GroupBox Header="How To Compare Files" Margin="0,10,0,0">
				<StackPanel Orientation="Vertical">
					<RadioButton GroupName="HowToCompareFiles" Content="Always compare each file independently" IsChecked="{QC:Binding '$P == CompareModes.IndividualFiles', P={Binding Path=CompareModesAvailable, Mode=OneTime}}" Checked="radioCompareMode_Independent_Checked" ToolTip="If selected, each file will be compared independently in its own window." />
					<StackPanel Orientation="Horizontal" Margin="30,2,0,0">
						<xctk:IntegerUpDown Minimum="1" Maximum="9999" Increment="1"  Value="{Binding Path=NumberOfIndividualFilesToCompareAtATime}" Width="60" />
						<Label Content="Maximum number of files to compare at a time">
							<Label.ToolTip>
								<TextBlock>
									The number of diff tool instances to launch at a time, allowing multiple files to be compared at the same time.<LineBreak />
									Experience may differ depending on your configured diff tool(s).
								</TextBlock>
							</Label.ToolTip>
						</Label>
					</StackPanel>
					
					<RadioButton GroupName="HowToCompareFiles" Content="Always combine and compare all files in a single window" IsChecked="{QC:Binding '$P == CompareModes.CombinedIntoSingleFile', P={Binding Path=CompareModesAvailable, Mode=OneTime}}" Checked="radioCompareMode_Combined_Checked" ToolTip="If selected, all files will be combined and compared in a single window." Margin="0,10,0,0" />
					<StackPanel Orientation="Horizontal" Margin="30,0,0,0">
						<CheckBox Content="Use same file headers in source and target files" IsChecked="{Binding Path=UseSameHeadersForCombinedFiles}">
							<CheckBox.ToolTip>
								<TextBlock>
									In the 2 combined files being compared, a header is placed above each sub-file's contents.<LineBreak /> 
									If checked, these headers will match so that only the original file differences are detected by the diff tool.<LineBreak />
									If unchecked, each file's header will differ and will be detected by the diff tool, making it more obvious which file the changes you are looking at are in.
								</TextBlock>
							</CheckBox.ToolTip>
						</CheckBox>
					</StackPanel>
					
					<RadioButton GroupName="HowToCompareFiles" Content="Allow me to decide by showing a checkbox on the UI" IsChecked="{QC:Binding '$P == CompareModes.AllowUserToChoose', P={Binding Path=CompareModesAvailable, Mode=OneTime}}" Checked="radioCompareMode_LetUserDecide_Checked" ToolTip="If selected, a checkout will be shown on the UI allowing you to specify which compare mode to use." Margin="0,10,0,0" />
				</StackPanel>
			</GroupBox>
			
			<StackPanel Orientation="Horizontal" VerticalAlignment="Center" Margin="0,10,0,0">
				<Button Content="Configure Diff Tool..." HorizontalAlignment="Left" Click="btnConfigureDiffTool_Click" ToolTip="Select the tool to use for comparing different types of files." />
				<TextBlock VerticalAlignment="Center" Margin="5,0,0,0">
						<Hyperlink NavigateUri="https://diffallfilesvisualstudioextension.codeplex.com/wikipage?title=Common%20Diff%20Tool%20Configurations%20For%20Visual%20Studio" RequestNavigate="Hyperlink_RequestNavigate">View common diff tool configurations</Hyperlink>
				</TextBlock>
			</StackPanel>
			
			<Button Content="Restore Default Settings" HorizontalAlignment="Right" Margin="0,10,0,0" Click="btnRestoreDefaultSettings_Click" />
		</StackPanel>
	</Grid>
</UserControl>
